﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Nodes;

namespace NP.BPMReportPlatform.Utilities
{
    public static class TextJsonHelper
    {
        public static JsonNode ToJsonNode<T>(this List<T> myList)
        {
            var jsonArray = new JsonArray();
            foreach (var item in myList)
            {
                jsonArray.Add(item);
            }

            // 将 JsonArray 赋值给 JsonNode
            JsonNode jsonNode = jsonArray;

            return jsonNode;
        }
    }
}
